package com.cskaoyan.javase.oop3._1interface._4example.model;

/**
 * model 实体层,用来存放程序中的实体对象,比如这里的商品对象,商品类
 *
 * @since 10:25
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Goods {
    // 商品的id必须是唯一的
    private int id;
    private String name;
    private double price;
    private String brand;

    public Goods(int id, String name, double price, String brand) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.brand = brand;
    }

    public void print() {
        System.out.println("名字为:" + name + "的商品,它的品牌是" + brand + ",它的商品ID是" + id + ",它的价格是:" + price);
    }

    public int getId() {
        return id;
    }
}
